import {Map, fromJS} from 'immutable';
import {expect} from 'chai';
import makeStore from '../src/store';
import * as actions from '../src/actions';

const E1 = 'Trainspotting';
const E2 = '28 Days Later';
const E3 = 'Sunshine';
const E4 = 'Millions';
const E5 = '127 Hours';

describe('store', ()=> {
    it('is a Redux store configured with the correct reducer', ()=> {
        const store = makeStore();
        expect(store.getState()).to.equal(Map());

        store.dispatch(actions.setEntries([E1, E2]));
        expect(store.getState()).to.equal(fromJS({
            entries: [E1, E2]
        }));
    });
});